"""
@Time ： 2021/11/17 17:13
@Auth ： ChenZhangKun
"""
import os
import unittest

from HTMLTestRunner import HTMLTestRunner

from cases import Cases

# 创建测试套件
suite = unittest.TestSuite()

runner = unittest.TextTestRunner()
# 运行套件
runner.run(suite)

# 集成测试报告
report_name = "测试报告名称"
report_title = "测试报告标题"
report_desc = "测试报告描述"
report_path = "./report"
report_file = report_path + "report.html"
# 创建文件夹
os.mkdir(report_path)
cases=[Cases('test_01')]
with open(report_file, "wb") as report:
    suite.addTests(cases)
    runner = HTMLTestRunner(stream=report, title=report_title, description=report_desc)
    runner.run(suite)
